package com.cmfi.domain;

import java.io.Serializable;
import java.time.Instant;
import java.util.Objects;

/**
 * 计划工单
 */
public class PlanWorkOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    //计划状态
    private String status;

    //计划人
    private String planner;

    //门架序列号
    private String grantrySerialNum;
    
    //RFID
    private String rfid;

    //计划来源
    private String source;

    //计划上线时间
    private Instant onlineTIme;
    
    //计划下线时间
    private Instant offlineTIme;
    
    //生产单号
    private String produceNo;
    
    //flag标记位, 0待完成且未绑定rfid，1执行中已绑定rfid，2已完成并释放rfid
    private int flag;

    public int getFlag() {
		return flag;
	}

	public void setFlag(int flag) {
		this.flag = flag;
	}

	public Long getId() {
        return this.id;
    }

    public PlanWorkOrder id(Long id) {
        this.setId(id);
        return this;
    }

    public void setId(Long id) {
        this.id = id;
    }

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getPlanner() {
		return planner;
	}

	public void setPlanner(String planner) {
		this.planner = planner;
	}

	public String getGrantrySerialNum() {
		return grantrySerialNum;
	}

	public void setGrantrySerialNum(String grantrySerialNum) {
		this.grantrySerialNum = grantrySerialNum;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public Instant getOnlineTIme() {
		return onlineTIme;
	}

	public void setOnlineTIme(Instant onlineTIme) {
		this.onlineTIme = onlineTIme;
	}

	public Instant getOfflineTIme() {
		return offlineTIme;
	}

	public void setOfflineTIme(Instant offlineTIme) {
		this.offlineTIme = offlineTIme;
	}

	public String getProduceNo() {
		return produceNo;
	}

	public void setProduceNo(String produceNo) {
		this.produceNo = produceNo;
	}

	public String getRfid() {
		return rfid;
	}

	public void setRfid(String rfid) {
		this.rfid = rfid;
	}

	@Override
	public String toString() {
		return "PlanWorkOrder [id=" + id + ", status=" + status + ", planner=" + planner + ", grantrySerialNum="
				+ grantrySerialNum + ", rfid=" + rfid + ", source=" + source + ", onlineTIme=" + onlineTIme
				+ ", offlineTIme=" + offlineTIme + ", produceNo=" + produceNo + ", flag=" + flag + "]";
	}

	@Override
	public int hashCode() {
		return Objects.hash(flag, grantrySerialNum, id, offlineTIme, onlineTIme, planner, produceNo, rfid, source,
				status);
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PlanWorkOrder other = (PlanWorkOrder) obj;
		return flag == other.flag && Objects.equals(grantrySerialNum, other.grantrySerialNum)
				&& Objects.equals(id, other.id) && offlineTIme == other.offlineTIme && onlineTIme == other.onlineTIme
				&& Objects.equals(planner, other.planner) && Objects.equals(produceNo, other.produceNo)
				&& Objects.equals(rfid, other.rfid) && Objects.equals(source, other.source)
				&& Objects.equals(status, other.status);
	}
    
}
